import scrapy


class CarSpider(scrapy.Spider):
    name = "car"
    allowed_domains = ["www.autohome.com.cn"]
    start_urls = ["https://www.autohome.com.cn/price/brandid_15"]

    def parse(self, response):
        name_list = response.xpath('//div[@class="tw-mb-2 tw-flex tw-flex-nowrap tw-items-center"]/a/text()')
        prcie_list = response.xpath('//div/a[@class="tw-text-[16px] tw-font-[500] !tw-text-[#f60]"]/text()')

        for i in range(len(name_list)):
            print(name_list[i].extract() + "-----" + prcie_list[i].extract() + '\n')
